home *** CD-ROM | disk | FTP | other *** search
- Path: isar.de!news
- From: Gerson Kurz <dekonstruktor@pergamon.isar.de>
- Newsgroups: comp.lang.c++
- Subject: Re: Life is strange, especially with Watcom
- Date: Tue, 30 Jan 1996 09:27:17 +0100
- Organization: Pergamon Sued GmbH
- Message-ID: <310DD665.1468@pergamon.isar.de>
- References: <DLxtH3.AMA.0.-s@cs.vu.nl>
- NNTP-Posting-Host: diskursplateau.pergamon.isar.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b4 (WinNT; I)
-
- Andre Versteeg wrote:
- >
- > I have trouble with the difference between C and C++ with Watcom 10.0:
- >
- > ---
- >
- > I have a library with the following function in the .H header file:
- >
- > int Setup(void)
- >
- > With this library came a .C example file which used this function as follows:
- >
- > int v;
- > v = Setup();
- >
- > All compiles very well, until I changed the code to:
- >
- > int v = Setup(); and changed the filename to .CPP
- >
- > Now the compiler screams the following:
- >
- > * Undefined reference: int near Setup(void)
- >
- > ----
- >
- > My question is (easy to guess):
- >
- > How can I change my code, so that the compiler generates it correctly ?
- > I'm compiling with DOS4GW in Protected Mode.
- >
- > Can somebody offer a solution ? I'm not allowed to change the library...
-
- wrap your include in a <extern "C"> sequence
-
- extern "C" {
- #include something.h
- }
-